package com.auction.mapper;

import com.auction.dto.SellerApplicationPageQueryDTO;
import com.auction.pojo.SellerInfo;
import com.auction.vo.SellerInfoVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SellerInfoMapper {
    /**
     * 根据用户ID查询卖家信息
     * 
     * @param userId
     * @return
     */
    @Select("SELECT * FROM seller_info WHERE user_id = #{userId}")
    SellerInfo selectByUserId(@Param("userId") Long userId);

    /**
     * 插入卖家信息
     * 
     * @param sellerInfo
     */
    void insert(SellerInfo sellerInfo);

    /**
     * 根据ID查询卖家信息
     * 
     * @param id
     * @return
     */
    @Select("SELECT * FROM seller_info WHERE id = #{id}")
    SellerInfo selectById(@Param("id") Long id);

    /**
     * 更新卖家信息
     * 
     * @param sellerInfo
     */
    void update(SellerInfo sellerInfo);

    /**
     * 分页查询卖家信息
     * @param pageQueryDTO
     * @return
     */
    Page<SellerInfoVO> page(SellerApplicationPageQueryDTO pageQueryDTO);
}